import dayjs from 'dayjs'
import { ref, Ref } from 'vue'

export function useDatePicker(date: Ref<string>) {
  const picker = ref(false)
  return {
    picker,
    onConfirm(value: Date) {
      picker.value = false
      date.value = dayjs(value).format('YYYY-MM-DD')
    },
  }
}
